{include file="header.html"}
<div class="title tc ml-30 mr-10" style="padding-top:0px">
	<h2>我要交流</h2>
</div>
<div class="content px-10">
<form name="myForm" id="myForm" action="/index.php?act=chat&st=saveUserChat" method="post">
	<section id="section1" style="padding-top:0">
		<table class="my-10" style="margin-bottom:0">
		    <tbody> 
		        <tr>
		            <td class="pl-10 tc"> 提出单位 <em>*</em></td><td class="pl-15"><input id="User_Company" name="User_Company" type="text"/><br/><font color='red' id='td_User_Company'></font></td>
		        </tr>
		        <tr>
		            <td class="pl-10 tc"> 姓名<em>*</em></td><td class="pl-15"><input id="User_Person" name="User_Person" type="text" /><br/><font color='red' id='td_User_Person'></font></td>
		        </tr>
		        <tr>
		            <td class="pl-10 tc"> 涉及产品<em>*</em></td><td class="pl-15"><input id="Product_Type" name="Product_Type" type="text" /><br/><font color='red' id='td_Product_Type'></font></td>
		        </tr>
		        <tr>
		            <td class="pl-10 tc"> 规格<em>*</em></td><td class="pl-15"><input id="Product_Spec" name="Product_Spec" type="text" /><br/><font color='red' id='td_Product_Spec'></font></td>
		        </tr>
		        <tr>
		            <td class="pl-10 tc"> 材质<em>*</em></td><td class="pl-15"><input id="Product_Grade" name="Product_Grade" type="text" /><br/><font color='red' id='td_Product_Grade'></font></td>
		        </tr>
		        <tr>
		            <td class="pl-10 tc"> 标题<em>*</em></td><td class="pl-15"><input id="Chat_Title" name="Chat_Title" type="text" /><br/><font color='red' id='td_Chat_Title'></font></td>
		        </tr>
		        <tr>
		            <td class="pl-20 tl" colspan="2">请输入交流内容：<em>*</em><br/>
		            	<textarea name="Chat_Content" style="width:95%;height:100px" id="Chat_Content"></textarea>
		            	<br/><font color='red' id='td_Chat_Content'></font>
		            </td>
		        </tr>
		    </tbody>
		</table>
		<input type="hidden" name="Chat_Type" value="{$chat_type}" />
		<p class="tc mt-10"><span id="btn_submit" class="btn w-150" style="display:inline-block"> 提&nbsp;&nbsp;&nbsp;&nbsp;交 </span>	</p>
	</section>
</form>
</div>
<script type="text/javascript">
$(function(){
	$("#btn_submit").click(function(){
		var User_Company = $.trim($("#User_Company").val());
		var User_Person = $.trim($("#User_Person").val());
		var Product_Type = $.trim($("#Product_Type").val());
		var Product_Spec = $.trim($("#Product_Spec").val());
		var Product_Grade = $.trim($("#Product_Grade").val());
		var Chat_Title = $.trim($("#Chat_Title").val());
		var Chat_Content = $.trim($("#Chat_Content").val());
		var errCount = 0;
		var errMsg = '';
		if(User_Company == '') {
			errMsg = "请输入提出单位！";
			$("#td_User_Company").html(errMsg).show();;
			errCount = errCount+1;
		}
		if(User_Person == '') {
			errMsg = "请输入姓名！";
			$("#td_User_Person").html(errMsg).show();;
			errCount = errCount+1;
		}
		if(Product_Type == '') {
			errMsg = "请输入涉及产品！";
			$("#td_Product_Type").html(errMsg).show();;
			errCount = errCount+1;
		}
		if(Product_Spec == '') {
			errMsg = "请输入规格！";
			$("#td_Product_Spec").html(errMsg).show();;
			errCount = errCount+1;
		}
		if(Product_Grade == '') {
			errMsg = "请输入材质！";
			$("#td_Product_Grade").html(errMsg).show();;
			errCount = errCount+1;
		}
		if(Chat_Title == '') {
			errMsg = "请输入标题！";
			$("#td_Chat_Title").html(errMsg).show();;
			errCount = errCount+1;
		}
		if(Chat_Content == '') {
			errMsg = "请输入交流内容！";
			$("#td_Chat_Content").html(errMsg).show();;
			errCount = errCount+1;
		}
		if(errCount == 0) {
			$("#myForm").submit();
		} else {
			return false;
		}
	});
	$("input,textarea").change(function(){
		var obj = $(this).attr("id");
		var objVal = $.trim($("#"+obj).val());
		if(objVal != '') {
			$("#td_"+obj).hide();
		}
	});
});
</script>
{include file="footer.html"}